<ul class="pagination">
  {% if paginator.has_previous %}
    <li><a href="?page={{ paginator.previous_page_number }}">&laquo;</a></li>
  {% else %}
    <li class="disabled"><span>&laquo;</span></li>
  {% endif %}
  {% for i in paginator.paginator.page_range %}
    {% if paginator.number == i %}
      <li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
    {% else %}
      <li><a href="?page={{ i }}">{{ i }}</a></li>
    {% endif %}
  {% endfor %}
  {% if paginator.has_next %}
    <li><a href="?page={{ paginator.next_page_number }}">&raquo;</a></li>
  {% else %}
    <li class="disabled"><span>&raquo;</span></li>
  {% endif %}
</ul>